package com.job.Yangmingyu.Zuoye0722.Zuoye2;

import com.job.Yangmingyu.Zuoye0722.Zuoye2.Exception01;

import java.util.*;

/**
 * @author Yangmingyu
 * @version 1.0
 * @since 2022-07-22 16:47:08
 */
public class Stringyichang {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.next();//输入一个字符串
        HashMap<Character,Integer> a=new LinkedHashMap<>();
        try {
            panduan(a, str);
            rongcuo(a, str);
        } catch (Exception01 e) {
            e.printStackTrace();
        }
    }
    public static void rongcuo(HashMap<Character,Integer> a, String str) throws Exception01 {

        if (str.isEmpty()){
            throw new Exception01("空字符串");
        }else if (a.isEmpty()) {
            throw new Exception01("无字母和数字");
        }
    }
    public static void panduan(HashMap<Character,Integer> a, String str){
        for (int i = 0; i <str.length() ; i++) {
            char b = str.charAt(i);
            if(Character.isUpperCase(str.charAt(i))||Character.isLowerCase(str.charAt(i))||Character.isDigit(str.charAt(i))){
                if(a.get(str.charAt(i)) == null){
                    a.put(str.charAt(i),1);
                }else{
                    a.put(str.charAt(i),a.get(str.charAt(i))+1);
                }
            }
        }
        for (Character key:a.keySet()) {
            System.out.println(key+"\t"+a.get(key));
        }
    }
}